package com.zeng.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author Zqm
 * @Title: MyBeanPostProcessor
 * @ProjectName SpringAnnotationDriven
 * @date 2019/1/14
 * 后置处理器  初始化前后进行处理  加入容器
 */
@Component
public class MyBeanPostProcessor implements BeanPostProcessor {



    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        System.out.println("postProcessBeforeInitialization ..."+s+"=>"+o);
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        System.out.println("postProcessAfterInitialization ..."+s+"=>"+o);
        return o;
    }
}
